Rails3 and `cd somehwere && do something`

Posted by Samer Abukhait on Stack Overflow See other posts from Stack Overflow or by Samer Abukhait
Published on 2011-01-14T18:22:28Z Indexed on 2011/01/15 4:53 UTC
Read the original article Hit count: 379

I have a rails project that has other projects under it, sub-projects have rake and bundler files.

When I do ruby -e `cd sub-project && rake`, or ruby -e `cd sub-project && bundle`, commands work as expected and use the sub-project rake/bundler files. However, when I do the same thing from a Rails3 console (rails 3.0.3), rake gives the error no such file to load -- initializer, and bundle operates as if it was fired from the root directory.

I tried the same commands from a Rails2.3.10 console and they worked as expected. Is Rails3 doing something wrong here?

I am using Ruby 1.9.2 via RVM.
$ ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby